﻿namespace TimeTravel.XnaLibrary.GamePlay
{
	/// <summary>
	/// A base class implementing IPriorityOrder. This class is immutable.
	/// </summary>
	public class PriorityOrder : IPriorityOrder
	{
		/// <summary>
		/// Gets the priority level of this order.
		/// </summary>
		public int Priority { get; private set; }

		/// <summary>
		/// Gets the command to be run by this order.
		/// </summary>
		public PriorityOrderCommand Command { get; private set; }

		/// <summary>
		/// Gets the condition to be met to run this order.
		/// </summary>
		public PriorityOrderCondition Condition { get; private set; }

		/// <summary>
		/// Creates a new PriorityObject instance with the specified parameters.
		/// </summary>
		/// <param name="priorityLevel">The level of importance of the order.</param>
		/// <param name="condition">The condition to be met in order to run the order.</param>
		/// <param name="command">The command to be executed.</param>
		public PriorityOrder(int priorityLevel, PriorityOrderCondition condition, PriorityOrderCommand command)
		{
			Priority = priorityLevel;
			Condition = condition;
			Command = command;
		}
	}
}
